clear
clc

% read data from output file
fileID = fopen('Result.txt','r');
classification = fscanf(fileID, '%d\n');

% read data from correct file
fileID = fopen('CorrectOutput.txt','r');
actualOutput = fscanf(fileID, '%d\n');

error = 0;

% compare the two matrices and get the number of errors
for i = 1 : length(classification)
    if actualOutput(i, 1) ~= classification(i, 1)
        error = error + 1;
    end
end

% get code accuracy
disp(strcat('Accuracy = ' ,num2str((1 - (error / length(classification))) * 100), ' %'));